package com.itheima.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.itheima.service.IDevicesService;

import java.util.List;

/**
* devices 相关api
* @author Wei
* @since 2021-8-6 15:43:51
*/
@RestController
@RequestMapping("/devices")
public class DevicesController{

@Autowired
private IDevicesService devicesService;
@RequestMapping("/getAllSubway")
    public ResponseEntity getAllSubwayByCityName(@RequestParam("cityName") String cityName){
       List<String> list =  devicesService.getAllSubwayByCityName(cityName);
       return ResponseEntity.ok(list);
    }
    @RequestMapping("/getAllPlat")
    public ResponseEntity getAllplatByLineNmae(@RequestParam("cityName") String cityName,@RequestParam("lineName") String lineName){
        List<String> list =  devicesService.getAllPlatFormByLineName(cityName,lineName);
        return ResponseEntity.ok(list);
}



}